<!-- Голосование: Отдельная запись -->

{{:title}}<h1 class="title-">{{tmp.post.title}}</h1>{{/:title}}

{{:body}}
	{{!connect "decoration/doctype/vote.css"}}
	<div class="content- typography doctype-vote-content">
		<p>{{tmp.post.question}}</p>
		{{?tmp.already_voted || !tmp.can_vote}}
		<p>Проголосовал <strong>{{tmp.post.overall_voters}}</strong> {{!splural tmp.post.overall_voters "человек" "" "а" "" sep=" "}}.{{?tmp.vote_closed}} Голосование закрыто.{{/?}}</p>
		{{/?}}
	</div>
	{{?tmp.already_voted || !tmp.can_vote || tmp.vote_closed}}
		<div class="doctype-vote-answers">
		{{!for tmp.post.answers do=@:answer}}{{:answer}}
			<div class="answer-">
				<div class="bar-"><div class="barscale-" style="width: {{!eval (*voters * 100 / tmp.post.max_voters) }}px;"></div></div>
				{{*text}} <span class="count-">— {{*voters}}</span>
			</div>
		{{/:answer}}
		</div>
		{{?tmp.can_open}}
		<ul class="buttons-">
			<form action="{{tmp.vote_url|safe}}" method="POST">
				<li class="neutral-"><span class="bg1-"><input type="submit" name="vote_open_button" value="Открыть" class="submit-" /></span></li>
			</form>
		</ul>
		{{/?}}
	{{?:!tmp.vote_closed && tmp.can_vote}}
		{{@:vote_form}}{{:vote_form}}
		<div class="doctype-vote-form">
			<form action="{{tmp.vote_url|safe}}" method="POST">
				<div class="vlist-">
				{{!for tmp.post.answers as='variant' do=@:answer_form}}{{:answer_form}}
					<fieldset class="vitem-"><input type="radio" value="{{variant.num}}" name="vote_variant" id="{{tmp.post.oid}}-{{variant.num}}"/> <label for="{{tmp.post.oid}}-{{variant.num}}">{{variant.text}}</label></fieldset>
				{{/:answer_form}}
				</div>
				<ul class="buttons-">
					<li class="accept-"><input type="submit" name="vote_button" value="Голосовать" class="submit-" /></li>
					{{?tmp.can_close}}
					<li class="neutral-"><input type="submit" name="vote_close_button" value="Завершить" class="submit-" /></li>
					{{/?}}
				</ul>
			</form>
		</div>
		{{/:vote_form}}
	{{/?}}
{{/:body}}

